
#import "BaseModel.h"

@implementation BaseModel

- (instancetype)initWithDic:(NSDictionary *)dic
{
    self = [super init];
    if (self) {
        [self setValuesForKeysWithDictionary:dic];
    }
    return self;
}

+ (instancetype)modelWithDic:(NSDictionary *)dic {

    return [[[self class] alloc] initWithDic:dic];

}

+ (NSMutableArray *)modelWithArray:(NSArray *)array {

    NSMutableArray *arrModel = [NSMutableArray array];
    for (NSDictionary *dic in array) {
        id model = [[self class] modelWithDic:dic];
        [arrModel addObject:model];
    }

    return arrModel;
    
}



-(void)setValue:(id)value forUndefinedKey:(NSString *)key {
    
}


@end
